package com.resign.carl.command.example1.api.impl;

import com.resign.carl.command.example1.api.Command;
import com.resign.carl.command.example1.api.Door;

/**
 * Created by carl.zhao on 2016/6/15.
 */
public class GarageDoorOpenCommand implements Command {

    private Door door;

    public GarageDoorOpenCommand(Door door){
        this.door = door;
    }

    @Override
    public void execute() {
        door.open();
    }

    @Override
    public void undo() {
        door.close();
    }

}
